#include "pch.h"

#include "math/point4.h"
#include "core/config.h"


#ifdef RE_USE_DX


namespace Math
{

	///
	point4::point4():
float4(0.0f,0.0f,0.0f,1.0f)
{

}


///
point4::point4(scalar x, scalar y, scalar z):
float4(x, y, z, 1.0f)
{

}


///
point4::point4(const float4 & rhs)
{

}





///
void point4::operator =(const Math::point4 &rhs)
{
	this->m_vec = rhs.m_vec;
}


///
void point4::operator =(const Math::float4 & rhs)
{
	this->m_vec = rhs.m_vec;
}


///
bool point4::operator ==(const Math::point4 & rhs) const
{
	return (0 != XMVector4Equal(this->m_vec, rhs.m_vec));
}


///
bool point4::operator ==(const Math::float4 & rhs) const
{
	return (0 != XMVector4Equal(this->m_vec, rhs.m_vec));
}


///
bool point4::operator !=(const Math::point4 & rhs) const
{
	return (0 != XMVector4NotEqual(this->m_vec, rhs.m_vec));
}


///
bool point4::operator !=(const Math::float4 & rhs) const
{
	return (0 != XMVector4NotEqual(this->m_vec, rhs.m_vec));
}


///
void point4::operator +=(const Math::vector4 & rhs)
{
	this->m_vec = XMVectorAdd(this->m_vec, rhs.m_vec);
}


///
void point4::operator -=(const Math::vector4 & rhs)
{
	this->m_vec = XMVectorSubtract(this->m_vec, rhs.m_vec);
}


///
Math::vector4 point4::operator +(const Math::point4 & rhs) const 
{
	return XMVectorAdd(this->m_vec, rhs.m_vec);
}


///
Math::point4 point4::operator +(const Math::vector3 & rhs) const 
{
	return XMVectorAdd(this->m_vec, rhs.m_vec);
}


///
Math::vector4 point4::operator -(const Math::point4 & rhs) const 
{
	return XMVectorSubtract(this->m_vec, rhs.m_vec);
}


///
Math::point4 point4::operator +(const Math::vector4 & rhs) const 
{
	return XMVectorAdd(this->m_vec, rhs.m_vec);
}


///
Math::point4 point4::operator -(const Math::vector4 & rhs) const 
{
	return XMVectorSubtract(this->m_vec, rhs.m_vec);
}





///
void point4::set(scalar x, scalar y, scalar z)
{
	this->m_vec = XMVectorSet(x, y, z, 1.0f);
}





///
point4 point4::origin()
{
	return point4(0.0f, 0.0f, 0.0f);
}

}

#endif